<template>
	<view class="u-content">
		<u-parse :content="nodes"></u-parse>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nodes:"",
				field: '',
				title: ''
			}
		},
		onLoad(options){
			let field = options.title;
			this.field = field;
			let title = '服务协议';
			title = field === 'service' ? '服务协议' : field === 'privacy' ? '隐私政策' : '关于我们';
			this.title = title;
			this.init();
		},
		onReady() {
			uni.setNavigationBarTitle({
				title: this.title
			});
		},
		methods: {
			init(){
				let a
				if(this.field=='service'){
					a='3'
				}else if(this.field=='privacy'){
					a='2'
				}else{
					a='4'
				}
				
				this.$http.post('api/sys/article',{
					id: a
				}).then(res =>{
					this.nodes = res.content;
					console.log(res);
				})
			}
		}
	}
</script>

<style>
.u-content {
        padding: 24rpx;
    }
</style>
